﻿@using System.Data;
@using DTcms.Common;
@model DTcms.Model.BaseModel
@{
    var m = (DTcms.Model.article)Model.info["article"];
    var siteModel = (DTcms.Model.site_channel)Model.info["site_model"];
    string category_title = Html.get_category_title(m.category_id, "图片分享");
    ViewBag.Title = m.title + "-" + category_title + "-" + Model.site.name;
    ViewBag.Keywords = m.seo_keywords;
    ViewBag.Description = m.seo_description;
    string category_nav = Html.get_category_menu("photo_list", m.category_id, ">");
}
@section HeaderContent{

}
<!--当前位置-->
<div class="section">
    <div class="location">
        <span>当前位置：</span>
        <a href="@Html.linkurl("index")">首页</a> &gt;
        <a href="@Html.linkurl("photo")">图片分享</a>
        @Html.Raw(category_nav)
    </div>
</div>
<!--/当前位置-->

<div class="section">
    <!--/页面右边-->
    <div class="right-260">
        <div class="bg-wrap nobg">
            <div class="sidebar-box">
                <h4>人气排行</h4>
                <ul class="txt-list">
                    @{
                        DataTable hotPhoto = Html.get_article_list(siteModel.name, 0, 10, "status=0", "click desc,id desc");
                        foreach (DataRow hotdr in hotPhoto.Rows)
                        {
                            int hotdr__loop__id = hotPhoto.Rows.IndexOf(hotdr) + 1;
                            <li>
                                <label class="hot">@hotdr__loop__id</label>
                                <a href="@Html.linkurl("photo_show",hotdr["id"])">@hotdr["title"]</a>
                            </li>
                        }
                    }
                </ul>
            </div>

            <div class="sidebar-box">
                <h4>推荐图片</h4>
                <ul class="side-img-list">
                    @{
                        DataTable redPhoto = Html.get_article_list(siteModel.name, 0, 5, "status=0 and is_red=1");
                        foreach (DataRow dr in redPhoto.Rows)
                        {
                            <li>
                                <div class="img-box">
                                    <img src="@dr["img_url"]" />
                                </div>
                                <div class="txt-box">
                                    <a href="@Html.linkurl("photo_show",dr["id"])">@dr["title"]</a>
                                    <span>@dr["add_time"]</span>
                                </div>
                            </li>
                        }
                    }
                </ul>
            </div>
        </div>
    </div>
    <!--/页面右边-->
    <!--页面左边-->
    <div class="left-auto">
        <div class="bg-wrap">
            <div class="meta">
                <h2>@m.title</h2>
                <div class="info">
                    <span><i class="iconfont icon-date"></i>@m.add_time</span>
                    <span><i class="iconfont icon-comment"></i>@Html.get_comment_count(siteModel.id,m.id,"is_lock=0")人评论</span>
                    <span><i class="iconfont icon-view"></i>@m.click 次</span>
                </div>
                <div class="note">
                    <p>@m.zhaiyao</p>
                </div>
            </div>

            <div class="album-list">
                <ul>
                    @if (m.albums != null)
                    {
                        foreach (var modelt in m.albums)
                        {
                            <li>
                                <a title="@modelt.remark" href="javascript:;">
                                    <img data-original="@modelt.original_path" src="@modelt.thumb_path" />
                                </a>
                            </li>
                        }
                    }
                </ul>
            </div>

            <div class="entry">
                @Html.Raw(m.content)
            </div>

            <!--上下一条-->
            <div class="next-box clearfix">
                <p class="prev">上一篇：@Html.Raw(Html.get_prevandnext_article("photo_show", -1, "没有了", 0, m.category_id, siteModel.name, m.id))</p>
                <p class="next">下一篇：@Html.Raw(Html.get_prevandnext_article("photo_show", 1, "没有了", 0, m.category_id, siteModel.name, m.id))</p>
            </div>
            <!--/上下一条-->
            <!--相关资讯-->
            <div class="rel-box">
                <h2 class="slide-tit">
                    <span>相关图片</span>
                </h2>
                <ul class="rel-list">
                    @{
                        DataTable relList = Html.get_article_list(siteModel.name, m.category_id, 4, "is_red=1 and id<>" + m.id);
                        foreach (DataRow dr in relList.Rows)
                        {
                            <li>
                                <div class="img-box">
                                    <a title="@dr["title"]" href="@Html.linkurl("photo_show",dr["id"])">
                                        <img src="@dr["img_url"]" />
                                    </a>
                                </div>
                                <div class="info">
                                    <h3><a title="@dr["title"]" href="@Html.linkurl("photo_show",dr["id"])">@dr["title"]</a></h3>
                                    <p>@dr["zhaiyao"]</p>
                                    <span>@dr["add_time"]</span>
                                </div>
                            </li>
                        }
                        if (relList.Rows.Count < 1)
                        {
                            <div class="nodata">暂无相关数据...</div>
                        }
                    }
                </ul>
            </div>
            <!--/相关资讯-->
            <!--网友评论-->
            @if (m.is_msg == 1)
            {
                @Html.Partial("_comment_box")
            }
            <!--/网友评论-->
        </div>
    </div>
    <!--/页面左边-->
</div>
@section Scripts{
    <script type="text/javascript">
        layui.use(['myaspx'], function () {
            var os = layui.myaspx;

            layer.photos({
                photos: '.album-list'
                , anim: 5
            });
            $('#articlList').get_comment_fech('.b_comment', '@Model.config.webpath');
        });
    </script>
}
